<script type="text/javascript">
$(function(){
    $("#checkall").on('click',function(){
      var inputs=$('.bootstrap-table').find('input');
      $(this).prop('checked') ? inputs.prop('checked','checked') : inputs.removeAttr('checked');
    })
})
function act(obj){
	var l=$('.bootstrap-table').find('input:checked').length;
	var url=$(obj).attr("url");
	if(l>0){
		  var ids=[];
		  $('input[name="user_id[]"]:checked').each(function(){
			 ids.push($(this).val());
		  })
		  url+="?ids="+ids;
				hiApp.modal(url,"user","发放学币");
			// $("#ids").val(ids);
	}else{
		$("#ids").val("");
		return false;	
	}
}
</script>

<div class="page-content" >
 
				<div class="panel panel-default">
				 <div class="panel-heading">
            <strong>学生管理</strong>
        </div>
					<div class="panel-body">
						<div id="toolbar" style="width: 100%;">
							<form id="filter" method="get"  class="form-horizontal">
								<div class="form-group">
									<div class="col-sm-3">
										<input type="text" name="kw"  value="<{$kw}>" class="form-control" placeholder="
姓名/手机/QQ">
									</div>
									<div class="col-sm-3" style="width:auto">
										<select name="province_id" class="combox input-medium" target="sectionselect" refurl="<{:U('School/get_ajax_school_sel')}>?province_id={value}" >
											<option value="0">全部省份</option>
											<volist name="province_list" id="vo"> <option 
												<if condition="$vo['id'] eq $province_id">selected="selected"</if>
												 value="<{$vo.id}>"><{$vo.name}>
												</option>
											</volist>
										</select>
										<select name="school_id" id="sectionselect" class="input-medium" >
											<option value="0">全部学校</option>
											<volist name="schools_list" id="vo"> <option 
												<if condition="$vo['id'] eq $school_id">selected="selected"</if>
												 value="<{$vo.id}>"><{$vo.name}>
												</option>
											</volist>
										</select>
										<!--<select name="class_id" id="school_select">
							<option value="0">全部班级</option>
							<volist name="classrooms_list" id="vo">
							<option <if condition="$vo['id'] eq $class_id">selected="selected"</if> value="<{$vo.id}>"><{$vo.name}></option>
							</volist>
							</select>--> 
									</div>
									<div class="col-sm-4" style="float:right; width:auto">
										<input type="submit" class="btn btn-primary pull-right" value="筛选">
									</div>
								</div>
								<div class="form-group">
									<div class="col-sm-8"> <a href="/BoxAddon/Forms/Index/fields/group_name/studentsForm" data-type="modal" class="btn btn-default">完善用户信息表单</a> <!--<a href="<{:U('School/import')}>" class="btn btn-default"> <i class="fa fa-plus"></i> 导入学生 </a>--> </div>
								</div>
								<input type="hidden" id="ids" />
							</form>
						</div>
						<div class="bootstrap-table">
							<div class="fixed-table-container" style="padding-bottom: 0px;">
								<div class="fixed-table-body">
									<table id="data-table" class="table">
										<thead>
											<tr>
												<th style=" width:30px" data-field="id"><div class="th-inner">
														<input type="checkbox" id="checkall"/>
													</div></th>
												<th style="" data-field="id"><div class="th-inner">用户ID</div></th>
												<th style="" data-field="created_at"><div class="th-inner ">昵称</div>
													<div class="fht-cell"></div></th>
												<th style="" data-field="created_at"><div class="th-inner ">登录方式</div>
													<div class="fht-cell"></div></th>
												<th style="" data-field="name"><div class="th-inner ">姓名</div>
													<div class="fht-cell"></div></th>
												<th style="" data-field="name"><div class="th-inner ">手机</div>
													<div class="fht-cell"></div></th>
												<th style="" data-field="created_at"><div class="th-inner ">qq</div>
													<div class="fht-cell"></div></th>
												<th style="" data-field="created_at"><div class="th-inner ">性别</div>
													<div class="fht-cell"></div></th>
												<th style="" data-field="created_at"><div class="th-inner ">添加时间</div>
													<div class="fht-cell"></div></th>
												<th style="" data-field="created_at"><div class="th-inner ">提问数</div>
													<div class="fht-cell"></div></th>
												<th style="" data-field="created_at"><div class="th-inner sortable both desc ui-sortable">经验值</div>
													<div class="fht-cell"></div></th>
												<th style="" data-field="created_at"><div class="th-inner th-inner sortable both asc ui-sortable">学币</div>
													<div class="fht-cell"></div></th>
												<th style="" data-field="created_at"><div class="th-inner ">购买课程数</div>
													<div class="fht-cell"></div></th>
												
												<!--<th style="" data-field="created_at"><div class="th-inner ">状态</div><div class="fht-cell"></div></th>-->
												<th style="" data-field="id"><div class="th-inner ">操作</div>
													<div class="fht-cell"></div></th>
											</tr>
										</thead>
										<tbody>
											<volist name="data" id="vo">
												<tr data-index="0">
													<td><input type="checkbox" name="user_id[]" value="<{$vo.user_id}>"></td>
													<td style=""><{$vo.user_id}></td>
													<td height="36" align="center" valign="middle"><{$vo.nickname}></td>
													<td height="36" align="center" valign="middle"><{$vo.sync_login}></td>
													<td style=" width:80px "><{$vo.real_name}></td>
													<td style=""><{$vo.mobile}></td>
													<td style=""><{$vo.qq}></td>
													<td style=""><{$gender[$vo['gender']]}></td>
													<td style=""><{$vo.add_time}></td>
													<!--<td style=""><{$vo['status']==1?"启用":"禁用"}></td>
			 -->
													<td height="36" align="center" valign="middle"><{$vo.ask_num}></td>
													<td height="36" align="center" valign="middle"><{$vo.xuebazi}></td>
													<td height="36" align="center" valign="middle"><{$vo.money}></td>
													<td height="36" align="center" valign="middle"><{$vo.subject_count}></td>
													<td style=""><a href="<{:U('School/add_student',array('id'=>$vo['id']))}>" class="btn btn-primary btn-xs">编辑</a>&nbsp;&nbsp;<!-- <a onclick=" return confirm('确认要删除吗？')"  href="<{:U('School/status_student',array('id'=>$vo['id']))}>" class="btn btn-primary btn-xs delete-this">删除</a> &nbsp;&nbsp;--> <a href="<php>echo AdminEduUrl;</php><{:U('show_open_courses',array('id'=>$vo['user_id']))}>" class="btn btn-primary btn-xs delete-this">开通课程</a></td>
												</tr>
											</volist>
										</tbody>
									</table>
								</div>
								<div><a onclick="return act(this)"  title="发放学币"   url="<php>echo AdminEduUrl;</php><{:U('School/send_money')}>"  class="btn btn-default selfmodal">发放学币</a>
							 
								</div>
								<include file="./Apps/BoxAdmin/View/Ace/Public/pager.html" /> </div>
						</div>
						<div class="clearfix"></div>
					</div>
				</div>
  <script>
  function ajaxSubmitSuccess(){
			$("#send_money_form").parents(".modal_popup ").modal("hide");
			dialog("操作成功");
}
  </script>
			</div>